package com.atguigu.guli.service.edu.controller;

import com.atguigu.guli.service.base.result.R;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
//处理跨域
public class LoginController {

    /*
     * 临时登录接口
     *
     */
    @PostMapping("/login")
    public R testLgoin() {
        return R.ok().data("token", "admin");
    }

    @GetMapping("/info")
    public R getInfo(){
        return R.ok()
                .data("roles","[admin]")
                .data("name","admin")
                .data("avatar","https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg");
    }
    /*
     * 退出
     *
     */
    @PostMapping("/logout")
    public R logout(){
        return R.ok();
    }

}
